import {createRouter, createWebHistory} from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      name:'welcome',
      component: () => import('@/views/WelCome.vue'),
      children: [
        {
          path:'',
          name:'welcome-login',
          component: () => import('@/welcome/LoginPage.vue'),
        },
        {
          path:'register',
          name:'welcome-register',
          component: () => import('@/welcome/RegisterPage.vue'),
        },
        {
          path:'forget',
          name:'welcome-forget',
          component: () => import('@/welcome/ForgetPage.vue'),
        },
        {
          path:'reset',
          name:'welcome-reset',
          component: () => import('@/welcome/ResetPage.vue'),
        }
      ]
    },
    {
      path:'/index',
      name:'index',
      component: () => import('@/views/Index.vue'),
      children: [
        {
          path:'',
          name:'index-message',
          component: () => import('@/components/index/MessagePage.vue'),
          children:[
            {
              path:'',
              name:'index-activities',
              component: () => import('@/components/index/Activities.vue'),
            },
            {
              path:'mealsAnalysis',
              name:'index-mealsAnalysis',
              component: () => import('@/components/healthyAnalysis/MealsAnalysis.vue'),
            },
            {
              path:'setting',
              name:'index-setting',
              component: () => import('@/components/setting/SettingPage.vue'),
            },{
              path:'personalCenter',
              name:'index-personalCenter',
              component: () => import('@/components/personalCenter/PersonalCenter.vue'),
            },
          ]
        },

      ]
    },
    {
      path:'/manager',
      name:'manager',
      component: () => import('@/manager/Manager.vue'),
      children: [
        {
          path:'person',
          name:'manager-person',
          component: () => import('@/manager/PersonManage.vue'),
        },
        {
          path:'',
          name:'manager-food',
          component: () => import('@/manager/FoodManage.vue'),
        },
        {
          path:'sports',
          name:'manager-sports',
          component: () => import('@/manager/SportsManage.vue'),
        },
        {
          path:'feedback',
          name:'manager-feedback',
          component: () => import('@/manager/FeedbackManage.vue'),
        },
        {
          path:'statistics',
          name:'statistics',
          component:()=>import('@/components/statistics.vue')
        },
        {
          path:'analysis',
          name:'analysis',
          component:()=>import('@/components/Analysis.vue')
        }

      ]
    },

  ]
})

export default router
